package com.da.javatest.spi;

import java.util.ServiceLoader;

/**
 * 需要加载src/META-INF/services下面的文件
 *
 */
public class DogTest {

    public static void main(String[] args) throws Exception {
        ServiceLoader<DogService> loaders = ServiceLoader.load(DogService.class);
        for (DogService d : loaders) {
            d.sleep();
        }
    }
}